<link rel="stylesheet" type="text/css" href="../addons/jy_sendgoods/resource/css/coupon-new.css?v=2018030310126">
<link rel="stylesheet" type="text/css" href="../addons/jy_sendgoods/resource/css/coupon.css?v=2.0.4">
<div class='fui-page fui-page-current'>
	<div class="fui-header">
		<div class="fui-header-left">
			<a class="back" onclick="window.history.go(-1);"></a>
		</div>
		<div class="title">领取的兑换券</div>
		<div class="fui-header-right">
			<a href="javascript:;" ng-click="access_json('jy_weishop/coupon.index/main')" class="external">
				<i class="icon icon-person2"></i>
			</a>
		</div>
	</div>
	<div class='fui-content coupon-index-bg'>
		<div class="fui-tab-scroll">
			<div class='container type-3'>
				<span ng-class="{'item':1, 'on':pagedata.params.type ==0}" ng-click="pagedata.params.type = 0;tool.get_list('jy_sendgoods/s_card/getlist/',true)">全部兑换券</span>
				<span ng-class="{'item':1, 'on':pagedata.params.type ==1}" ng-click="pagedata.params.type = 1;tool.get_list('jy_sendgoods/s_card/getlist/',true)">待使用</span>
				<span ng-class="{'item':1, 'on':pagedata.params.type ==2}" ng-click="pagedata.params.type = 2;tool.get_list('jy_sendgoods/s_card/getlist/',true)">已使用</span>					
			</div>
		</div>
		<div id="carousel-container" class="carousel slide" data-role="carousel" data-param-auto="true" ng-if="pagedata.couponset.hdps">
			<div class="carousel-inner" role="listbox">
				<div ng-repeat="nav in pagedata.couponset.hdps" ng-class="{'item':1, 'active':$index==0}" >
					<a href="{{nav.url}}">
						<img ng-src="{{tomedia(nav.image) || '../core/resource/images/banner-1.jpg'}}" style="display: block; width: 100%; height: 100%;">
					</a>
				</div>
			</div>
			<style>
					.fui-swipe-page .fui-swipe-bullet {background: {background}; opacity: {opacity};}
					.fui-swipe-page .fui-swipe-bullet.active {opacity: 1;}
			</style>
			<div id="carousel-jinyun" class="fui-swipe-page" style="padding: 0 5px; bottom: 10px; ">
				<div class="fui-swipe-bullet" ng-repeat="nav in pagedata.couponset.hdps" ng-class="{'active':$index==0}" data-target="#carousel-container" data-slide-to="{{$index}}"></div>
			</div>
		</div>
		<script>
			require(['bootstrap', 'hammer'], function($, Hammer){
				$('#carousel-container').carousel();
				var mc = new Hammer($('#carousel-container').get(0));
				mc.on("panleft", function(ev) {
					$('#carousel-container').carousel('next');
				});
				mc.on("panright", function(ev) {
					$('#carousel-container').carousel('prev');
				});
			});
		</script>
		<div ng-if="pagedata.list.length<=0" class="fui-message fui-message-popup in content-empty" style=" margin-top: 0; padding-top: 0; position: relative; height: auto; background: none;">
				<div class="icon ">
					<i class="icon jinyunicon icon-information"></i>
				</div>
				<div class="content">您还没有任何兑换券~</div>
		</div>
		<!--内容加载-->
		<div id='container' class="coupon-container coupon-index-list">				
			<a ng-repeat="coupon in pagedata.list"  class="coupon-item {{coupon.color}}">
				<div class="coupon-type"   style="background:{{coupon.titlecolor}">兑换券</div>
				<div ng-if="coupon.settitlecolor !=1" class="coupon-type"   >{{coupon.tagtitle}}</div>
				<div class="coupon-left">
					<div class="title"></div>
					<div class="subtitle">{{coupon.goods.title}}</div>
					<div ng-if="coupon.t>0 && coupon.issend ==1" class="subtitle light">剩余{{coupon.last}}/{{coupon.t}}张</div>
					<div ng-if="coupon.t<=0 && coupon.issend ==1" class="subtitle light">不限制</div>
				</div>
				<div class="coupon-right">
					<div class="title">{{coupon.goods.title}}</div>
					<div class="subtitle">可用于兑换商品</div>
					<div ng-if="coupon.issend == 0 && coupon.issendtime ==1" class="subtitle light">
						<span>距离开始：</span>
						<span id="start{{coupon.id}}" class="starttime">
                             <span class="day">-</span>
                             <span class="dw">:</span>
                             <span class="hour">-</span>
                             <span class="dw">:</span>
                             <span class="minute">-</span>
                             <span class="dw">:</span>
                             <span class="second">-</span>
                        </span>
					</div>
					<div ng-if="coupon.issend == 1 && coupon.issendtime ==1" class="subtitle light">
						<span>距离结束：</span>
						<span id="end{{coupon.id}}" class="starttime">
                             <span class="day">-</span>
                             <span class="dw">:</span>
                             <span class="hour">-</span>
                             <span class="dw">:</span>
                             <span class="minute">-</span>
                             <span class="dw">:</span>
                             <span class="second">-</span>
                        </span>
					</div>
					<div ng-if="coupon.order.optionid>0" class="subtitle light">规格：{{coupon.option_title}}</div>
					<div class="usetime">
						<div class="text">{{coupon.title4}}</div>
						<div ng-if="coupon.isuse ==1" class="usebtn">已使用</div>
						<div ng-if="coupon.isuse ==0" class="usebtn" ng-click="access_json('/exchange/main/&id='+coupon.id)">立即使用</div>
					</div>
				</div>
			</a>
		
		</div>
	</div>
	</div>
<script>
scope.tool.get_list('jy_sendgoods/s_card/getlist/',true);
scope.pagedata.scroll_bottom=function(){
	scope.tool.get_list('jy_sendgoods/s_card/getlist/');
}
</script>